<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script>
    function f1(){
        //001001003
        let regExp = new RegExp("^"+"001001003"+"[0-9]{3}$");
        if (regExp.test("00100100300a")){
            alert("通过")
        }else {
            alert("不通过")
        }
    }
    function f2() {
        let regExp = new RegExp("^ +&");
        alert(regExp.test(' '));
    }
    f2()

</script>
<body>

</body>
</html>